const path = require('path');
const htmlWebpackPlugin = require('html-webpack-plugin');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
module.exports = {

    entry: path.join(__dirname,'./src/main.js'),//入口文件
    output: { //指定输出选项
        path:path.resolve(__dirname,'./dist'), //输出路径
        filename:'bundle.js' //指定输出文件的名称
    },
    mode:"development",
    plugins:[
        new htmlWebpackPlugin({
            template:path.join(__dirname,'./src/index.html'),
            filename:"index.html"
        }),
        new VueLoaderPlugin()
    ],
    module:{
        rules:[
            {test:/\.css$/ ,use:["style-loader","css-loader"]},
            { test:/\.less$/,use:["style-loader","css-loader","less-loader"]},
            { test:/\.scss$/,use:["style-loader","css-loader","sass-loader"]},
            { test : /\.(png|gif|jpg|jpeg)$/,use:"url-loader?limit=3500&name=[hash:8]-[name].[ext]"},
            { test : /\.(woff|woff2|eot|svg|ttf)$/,use:"url-loader"},
            { test : /\.js$/,use:"babel-loader",exclude:/node_modules/},
            { test : /\.vue$/, use: "vue-loader"} //配置 vue 处理文件的第三方loader

        ]
    }
    // },
    // resolve:{
    //     alias:{
    //         "vue$": "vue/dist/vue.js" //修改vue被导入的时候包的路径
    //     }
    // }


}